import uuid

from src.common.logger import getLogger
from src.modules.setting.dao import SystemSettingDao

logger = getLogger()

def load_setting_list(args):
    list = SystemSettingDao.load_setting_list(args)
    return list

def save_setting_item(args):
    from ..model.SystemSetting import SystemSetting

    for key, value in args.items():
        system_setting = SystemSetting()
        system_setting.id = uuid.uuid4()
        system_setting.source = args.get("source")
        system_setting.name = key
        system_setting.content = value
        SystemSettingDao.save_setting_item(system_setting)
